import axios from "@/request/request"
import qs from "qs"

// 获取精品推荐的数据
export const jingpinAPT = () => axios.get("/products/recommend")

// 获取热门数据
export const remenAPT = () => axios.get("/products/hot")

// 发送注册短信验证码
export const sendSMSAPT = (params) => axios.post("/sendSMS", qs.stringify(params))

//  发送登录请求
export const PhoneReginAPT = (params) => axios.post("/phoneRegin", qs.stringify(params))

// 发送扫码登录请求
export const WechatUsersAPT = (params) => axios.post("/wechatUsers/PCLogin", qs.stringify(params))

// 手机绑定微信

export const BindingAPT = (params) => axios.post("/wechatUsers/binding", qs.stringify(params))

// 获取用户信息请求

export const UserProfilesAPT = () => axios.get("/shop/userProfiles")

// 详情页请求

export const ProductsAPT = (id) => axios.get(`/products/${id}`)

// 加入购物车

export const CartsAPT = (params) => axios.post("/shop/carts/add", qs.stringify(params))

// 全部商品
export const ProductsAPI = (params) => axios.get("/products", { params });

// 查看购物车
export const ShopAPI = () => axios.get(`/shop/carts`);

// 删除商品

export const DelAPI = (id) => axios.delete(`/shop/carts?productIds=${id}`);